unit SmallStruct.Configuration.TSSDatabaseConnectionConfiguration;

interface

uses Classes,
  SmallStruct.Configuration.TSSConfiguration,
  SmallStruct.Configuration,
  SmallStruct.BusinessObject.TSSAdvancedBusinessObject;

type
  TSSDatabaseConnectionConfiguration = class(TSSConfiguration, ISSDatabaseConnectionConfiguration)
  private
    _ConnectionString: TStringList;
    _ConnectionName, _DriverClassName: string;
  public
    function GetConnectionName: string;
    function GetConnectionString: TStringList;
    function GetDriverClassName: string;
    procedure SetConnectionString(const AConnectionString: string);
    procedure SetDriverClassName(const ADriverClassName: string);
    procedure SetConnectionName(const AConnectionName: string);
    procedure SetConnection;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

uses SmallStruct.Tools;

{ TSSDatabaseConnectionConfiguration }

constructor TSSDatabaseConnectionConfiguration.Create(AOwner: TComponent);
begin
  inherited;
  _ConnectionString := TStringList.Create;
end;

destructor TSSDatabaseConnectionConfiguration.Destroy;
begin
  _ConnectionString.Free;
  inherited;
end;

function TSSDatabaseConnectionConfiguration.GetConnectionName: string;
begin
  Result := _ConnectionName;
end;

function TSSDatabaseConnectionConfiguration.GetConnectionString: TStringList;
begin
  Result := _ConnectionString;
end;

function TSSDatabaseConnectionConfiguration.GetDriverClassName: string;
begin
  Result := _DriverClassName;
end;

procedure TSSDatabaseConnectionConfiguration.SetConnection;
begin

end;

procedure TSSDatabaseConnectionConfiguration.SetConnectionName(const AConnectionName: string);
begin
  _ConnectionName := AConnectionName;
end;

procedure TSSDatabaseConnectionConfiguration.SetConnectionString(const AConnectionString: string);
begin
  _ConnectionString := TSSString.SplitStringToList(AConnectionString, ',')
end;

procedure TSSDatabaseConnectionConfiguration.SetDriverClassName(const ADriverClassName: string);
begin
  _DriverClassName := ADriverClassName;
end;

end.
